/* 
 * Copyright [2018] [Alex/libo(liboms@hotmail.com)]
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.hyts.dbmeta.config.connection;

import com.hyts.dbmeta.base.AbstractConnectionConfig;

/**
 * @title DbConnectionConfig.java  
 * @package com.hyts.dbmeta.config  
 * @description 数据库连接操作
 * @author libo/Alex
 * @email liboms@hotmail.com/liboware@163.com  
 * @date 2018年5月27日 
 * @version V1.0 
 */
public final class MySQLConnectionConfig extends AbstractConnectionConfig {
	
	/**  
	 * <p>mysql数据库连接配置</p> 
	 * jdbc:mysql://localhost:3306/test?user=root&password=&useUnicode=true&characterEncoding=gbk&autoReconnect=true&failOverReadOnly=false
	 * 
	 * @fieldName mysqlBaseConnectionConfig
	 * @fieldType String
	 */ 
	private static String mysqlBaseConnectionConfig = "jdbc:mysql://%s:%s/%s";
	
	/**  
	 * <p>认证信息字符串服务</p> 
	 * @fieldName mysqlAuthConnectionConfig
	 * @fieldType String
	 */ 
	private static String mysqlAuthConnectionConfig = "?user=%s&password=%s&";

	/**  
	 * <p>数据库属性连接配置</p> 
	 * @fieldName mysqlAttributeConnectionConfig
	 * @fieldType String
	 */ 
	private static String mysqlAttributeConnectionConfig = "useUnicode=true&characterEncoding=%s&autoReconnect=true&failOverReadOnly=false&serverTimezone=Asia/Shanghai";


	@Override
	public String baseConnectionConfig() {
		return mysqlBaseConnectionConfig;
	}

	@Override
	public String attributeConnectionConfig() {
		return mysqlAttributeConnectionConfig;
	}


	@Override
	public String authConnectionConfig() {
		return mysqlAuthConnectionConfig;
	}
}
